package com.chinaums.sftp.internal.connection;

import org.apache.flink.annotation.PublicEvolving;

import javax.annotation.Nullable;
import java.io.Serializable;
import java.util.Optional;

@PublicEvolving
public class SftpConnectionOptions implements Serializable {
    private static final long serialVersionUID = 1L;

    protected String host;
    protected Integer port;
    @Nullable
    protected String username;
    @Nullable
    protected String password;
    protected int timeout;

    protected String path;
    protected boolean fileCheckOkFile;

    protected SftpConnectionOptions(
            String host,
            Integer port,
            @Nullable String username,
            @Nullable String password,
            int timeout,
            String path,
            boolean fileCheckOkFile
    ) {
        this.host = host;
        this.port = port;
        this.username = username;
        this.password = password;
        this.timeout = timeout;
        this.path = path;
        this.fileCheckOkFile = fileCheckOkFile;
    }

    public boolean isFileCheckOkFile() {
        return fileCheckOkFile;
    }

    public String getPath() {
        return path;
    }

    public String getHost() {
        return host;
    }

    public Integer getPort() {
        return port;
    }

    @Nullable
    public Optional<String> getUsername() {
        return Optional.ofNullable(username);
    }

    @Nullable
    public Optional<String> getPassword() {
        return Optional.ofNullable(password);
    }

    public int getTimeout() {
        return timeout;
    }


}
